uniform sampler2D texture;
uniform float isTextured;

void main(void)
{
	if(isTextured == 1.0f)
	{
		vec4 pixelTex = texture2D(texture, gl_TexCoord[0].st) ;

		float r = gl_Color.x * (1 - pixelTex.w) + pixelTex.x * pixelTex.w;
		float g = gl_Color.y * (1 - pixelTex.w) + pixelTex.y * pixelTex.w;
		float b = gl_Color.z * (1 - pixelTex.w) + pixelTex.z * pixelTex.w;
		
		gl_FragColor = vec4(r,g,b,1);
	}
	else
	{
		gl_FragColor = gl_Color;
		
	}
}